import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Test;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author: Paul Chan
 * @Date: 2023/3/27 17:33
 */

public class CodeValueLibraryTester {

  @Test
  public void test() {
    int start = 1165020;
    int end = 1217819;
    File file = new File("C:\\Users\\24353\\Desktop\\泰宝/L09336#1030009155#壳牌209升微点码2-2#泰宝#508825#0000000001165020#52800.txt");
    try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
      int current = start;
      while (current <= end) {
        String code = StringUtils.leftPad(String.valueOf(current), 16, "0");
        if(current != start) {
          writer.newLine();
        }
        writer.write(code);
        current++;
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

}
